package cn.com.qingz.modules.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;

import cn.com.qingz.modules.user.model.Resource;
import cn.com.qingz.modules.user.model.Role;
import cn.com.qingz.modules.user.vo.RoleAuthorityVo;
import cn.com.qingz.modules.user.vo.RoleCondition;
import tk.mybatis.mapper.common.Mapper;

public interface RoleMapper extends Mapper<Role> {

    public List<Role> queryRoleByUserId(@Param("userid") Long userid);

    public PageList<RoleAuthorityVo> queryRolePage(RoleCondition condition, PageBounds pageBounds);

    public List<Role> getAll(Role r);

    public void insertRole(Role r);

    public void updateRole(Role r);

    public void deleteRole(Role r);

    public Role getRoleById(Role r);

    public List<Resource> getAllResource();

    public Integer countRoleCode(@Param("code") String code);

    public Integer countResourceCode(@Param("code") String code);

    public void updateRoleStatus(@Param("ids") List<String> ids, @Param("status") String status);

}
